/*
 * XML Type:  FlightsType
 * Namespace: http://xscraper.openjawtech.com/schema
 * Java type: com.openjawtech.xscraper.schema.FlightsType
 *
 * Automatically generated - do not modify.
 */
package com.openjawtech.xscraper.schema.impl;
/**
 * An XML FlightsType(@http://xscraper.openjawtech.com/schema).
 *
 * This is a complex type.
 */
public class FlightsTypeImpl extends org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements com.openjawtech.xscraper.schema.FlightsType
{
    
    public FlightsTypeImpl(org.apache.xmlbeans.SchemaType sType)
    {
        super(sType);
    }
    
    private static final javax.xml.namespace.QName DEPARTURE$0 = 
        new javax.xml.namespace.QName("", "departure");
    private static final javax.xml.namespace.QName ARRIVAL$2 = 
        new javax.xml.namespace.QName("", "arrival");
    private static final javax.xml.namespace.QName FLIGHT$4 = 
        new javax.xml.namespace.QName("", "flight");
    
    
    /**
     * Gets the "departure" element
     */
    public java.lang.String getDeparture()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(DEPARTURE$0, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "departure" element
     */
    public org.apache.xmlbeans.XmlString xgetDeparture()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(DEPARTURE$0, 0);
            return target;
        }
    }
    
    /**
     * Sets the "departure" element
     */
    public void setDeparture(java.lang.String departure)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(DEPARTURE$0, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(DEPARTURE$0);
            }
            target.setStringValue(departure);
        }
    }
    
    /**
     * Sets (as xml) the "departure" element
     */
    public void xsetDeparture(org.apache.xmlbeans.XmlString departure)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(DEPARTURE$0, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlString)get_store().add_element_user(DEPARTURE$0);
            }
            target.set(departure);
        }
    }
    
    /**
     * Gets the "arrival" element
     */
    public java.lang.String getArrival()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(ARRIVAL$2, 0);
            if (target == null)
            {
                return null;
            }
            return target.getStringValue();
        }
    }
    
    /**
     * Gets (as xml) the "arrival" element
     */
    public org.apache.xmlbeans.XmlString xgetArrival()
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(ARRIVAL$2, 0);
            return target;
        }
    }
    
    /**
     * Sets the "arrival" element
     */
    public void setArrival(java.lang.String arrival)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.SimpleValue target = null;
            target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(ARRIVAL$2, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.SimpleValue)get_store().add_element_user(ARRIVAL$2);
            }
            target.setStringValue(arrival);
        }
    }
    
    /**
     * Sets (as xml) the "arrival" element
     */
    public void xsetArrival(org.apache.xmlbeans.XmlString arrival)
    {
        synchronized (monitor())
        {
            check_orphaned();
            org.apache.xmlbeans.XmlString target = null;
            target = (org.apache.xmlbeans.XmlString)get_store().find_element_user(ARRIVAL$2, 0);
            if (target == null)
            {
                target = (org.apache.xmlbeans.XmlString)get_store().add_element_user(ARRIVAL$2);
            }
            target.set(arrival);
        }
    }
    
    /**
     * Gets array of all "flight" elements
     */
    public com.openjawtech.xscraper.schema.FlightType[] getFlightArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            java.util.List targetList = new java.util.ArrayList();
            get_store().find_all_element_users(FLIGHT$4, targetList);
            com.openjawtech.xscraper.schema.FlightType[] result = new com.openjawtech.xscraper.schema.FlightType[targetList.size()];
            targetList.toArray(result);
            return result;
        }
    }
    
    /**
     * Gets ith "flight" element
     */
    public com.openjawtech.xscraper.schema.FlightType getFlightArray(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.openjawtech.xscraper.schema.FlightType target = null;
            target = (com.openjawtech.xscraper.schema.FlightType)get_store().find_element_user(FLIGHT$4, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            return target;
        }
    }
    
    /**
     * Returns number of "flight" element
     */
    public int sizeOfFlightArray()
    {
        synchronized (monitor())
        {
            check_orphaned();
            return get_store().count_elements(FLIGHT$4);
        }
    }
    
    /**
     * Sets array of all "flight" element
     */
    public void setFlightArray(com.openjawtech.xscraper.schema.FlightType[] flightArray)
    {
        synchronized (monitor())
        {
            check_orphaned();
            arraySetterHelper(flightArray, FLIGHT$4);
        }
    }
    
    /**
     * Sets ith "flight" element
     */
    public void setFlightArray(int i, com.openjawtech.xscraper.schema.FlightType flight)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.openjawtech.xscraper.schema.FlightType target = null;
            target = (com.openjawtech.xscraper.schema.FlightType)get_store().find_element_user(FLIGHT$4, i);
            if (target == null)
            {
                throw new IndexOutOfBoundsException();
            }
            target.set(flight);
        }
    }
    
    /**
     * Inserts and returns a new empty value (as xml) as the ith "flight" element
     */
    public com.openjawtech.xscraper.schema.FlightType insertNewFlight(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.openjawtech.xscraper.schema.FlightType target = null;
            target = (com.openjawtech.xscraper.schema.FlightType)get_store().insert_element_user(FLIGHT$4, i);
            return target;
        }
    }
    
    /**
     * Appends and returns a new empty value (as xml) as the last "flight" element
     */
    public com.openjawtech.xscraper.schema.FlightType addNewFlight()
    {
        synchronized (monitor())
        {
            check_orphaned();
            com.openjawtech.xscraper.schema.FlightType target = null;
            target = (com.openjawtech.xscraper.schema.FlightType)get_store().add_element_user(FLIGHT$4);
            return target;
        }
    }
    
    /**
     * Removes the ith "flight" element
     */
    public void removeFlight(int i)
    {
        synchronized (monitor())
        {
            check_orphaned();
            get_store().remove_element(FLIGHT$4, i);
        }
    }
}
